package com.example.springboot.controller;

import com.example.springboot.pojo.Classes;
import com.example.springboot.pojo.R;
import com.example.springboot.service.ClassesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import sun.misc.Cleaner;

import java.util.List;

/**
 * @outhor fufeixiang
 * @date 2021-11-16
 */
@RestController
@RequestMapping("/classes")
public class ClassesController {

    @Autowired
    private ClassesService classesService;
    //查询所有班级信息
    @GetMapping("/list")
    public R findAll(){
        //查询所有班级
        List<Classes> classes = classesService.findAll();
        //返回
        return R.ok().data("list",classes);
    }



}
